<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="en-gb" http-equiv="Content-Language" />
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />
<style type="text/css">
.style1 {
	font-family: Arial, Helvetica, sans-serif;
}
.style2 {
	font-size: large;
	color: #FF0000;
}
    .style3
    {
        color: #FFFFFF;
        background-color: #000000;
    }
.sql1-reservedword { color: #0000FF; font-weight: bold; }
.sql1-identifier { color: #808000; }
.sql1-symbol { color: #0000FF; }
.sql1-tablename { color: #FF00FF; }
.sql1-number { color: #800080; }
</style>
</head>

<body style="font-family: Arial, Helvetica, sans-serif">

<h1 class="style1">Notes on using TortoiseSVN</h1>
<p class="style1"><em>NGH 20/5/11</em></p>
<p class="style1">Download the latest version.
<a href="http://tortoisesvn.net/downloads.html">
http://tortoisesvn.net/downloads.html</a></p>
<p class="style1">Install it.</p>
<h2 class="style1">Create a local copy of the SVN tree</h2>
<p class="style1">Here are the steps to create a local copy of the SVN tree:</p>
<p>
<img alt="" class="style1" height="334" src="howtoImages/1.png" width="940" /></p>
<p class="style1">Create a folder. It can be anywhere, and named anything you 
want. Here g:\LaosTravellerDemo. </p>
<p><img class="style1" height="334" src="howtoImages/2.png" width="940" /></p>
<p class="style1">Right mouse click and choose SVN Checkout...&nbsp;</p>
<p><img class="style1" height="602" src="howtoImages/3.png" width="968" /></p>
<p class="style1">Choose the subversion repository hosted on Google:</p>
<p class="style1">
<a href="https://laostraveller.googlecode.com/svn/trunk/%20laostravelle">https://laostraveller.googlecode.com/svn/trunk/ laostravelle</a></p>
<p class="style1">Do not ask be why it's https://laostraveller.googlecode.com/svn/trunk/ 
laostravelle without the &quot;r&quot;</p>
<p><img class="style1" height="363" src="howtoImages/4.png" width="468" /><span class="style1">&nbsp;</span></p>
<p class="style1">Click OK. (You will be asked for credentials from the Google 
SVN server.)</p>
<p><img class="style1" height="461" src="howtoImages/5.png" width="667" /></p>
<p class="style1">Now we have a local copy:</p>
<p><img class="style1" height="489" src="howtoImages/6.png" width="1007" /></p>
<p class="style1">The green tick show that we have the latest version.</p>
<h2 class="style1">Making an edit, and commit that change.</h2>
<p class="style1">Now let's make a trivial change to adventure.htm</p>
<p><img class="style1" height="489" src="howtoImages/7.png" width="1007" /></p>
<p class="style1">Use notepad...</p>
<p><img class="style1" height="472" src="howtoImages/8.png" width="835" /></p>
<p class="style1">I'm adding (test)</p>
<p class="style1">Save the change. Note the red exclamation mark.</p>
<p><img class="style1" height="489" src="howtoImages/9.png" width="1007" /></p>
<p class="style1">&nbsp;I am happy about the change so I will commit it.</p>
<p><img class="style1" height="646" src="howtoImages/10.png" width="1034" /></p>
<p class="style1">It's good practice to add a comment. (Do as I say, not what I 
do!)</p>
<p><img class="style1" height="513" src="howtoImages/11.png" width="519" /></p>
<p class="style1">The change is saved...</p>
<p><img class="style1" height="461" src="howtoImages/12.png" width="667" /></p>
<p><img class="style1" height="489" src="howtoImages/13.png" width="1007" /></p>
<p class="style1">The red<span class="style2"> ! </span>has gone.</p>
<h2 class="style1">Do a diff</h2>
<p class="style1">I can choose to &quot;do a diff&quot; to see changes...</p>
<p><img class="style1" height="676" src="howtoImages/14.png" width="1123" /></p>
<h2 class="style1">Revert </h2>
<p class="style1">I can revert to a previous version</p>
<p><img class="style1" height="853" src="howtoImages/15.png" width="1146" /></p>
<p class="style1">&nbsp;</p>
<p><img class="style1" height="248" src="howtoImages/16.png" width="321" /></p>
<p class="style1">Click show log to list previous revisions</p>
<p><img class="style1" height="444" src="howtoImages/17.png" width="642" /></p>
<p class="style1">I will pick revision 9. (Not that I have much choice in the 
above!)</p>
<p><img class="style1" height="248" src="howtoImages/18.png" width="321" /></p>
<p><img class="style1" height="306" src="howtoImages/19.png" width="667" /></p>
<p class="style1">.. and look - the old version is back!</p>
<p><img class="style1" height="472" src="howtoImages/20.png" width="835" /></p>
<h1 class="style1">Daily workflow</h1>
<p class="style1">Get in to the habit of the following...</p>

<p class="style1">&quot;Get the latest&quot; by right mouse clicking on a folder. (Doesn't 
have to be root as here.)</p>
<p class="style1"><img height="654" src="howtoImages/22.png" width="964" /></p>
<p class="style1">Then you'll get the latest...</p>
<p class="style1"><img height="306" src="howtoImages/21.png" width="667" /></p>
<p class="style1">Build and run unit tests to assure yourself that nobody else 
has broken anything. (At the time of writing there is no validation on our 
LaosTraveller website: if an idiot deletes a web page we won't know until a user 
tries to load it.)</p>
<p class="style1">Ghastly! That's one of many reasons why I hate and despise web 
development. (The people and the technologies.)</p>
<h2 class="style1">Filters</h2>
<p class="style1">You don't want the SVN repository to hold temporary files that are created by 
Visual Studio. Tell the Tortoise SVN client what you don't want to put in to the 
SVN repository.</p>
<p><img class="style1" height="868" src="howtoImages/31.png" width="704" /></p>
<p class="style1">I suggest adding &quot;_ReSharper.* bin obj Bin *.suo&quot; These are folders and 
temporary files that would clutter up the repository; and are a waste of time 
uploading.</p>
    <p class="style1">Also&nbsp; tick the <em>use &quot;_svn&quot; instead of &quot;.svn&quot; directories.</em> 
        Visual studio attempts to deploy .svn directories to target web sites if you use 
        the default .svn. It won&#39;t if you use &quot;_svn&quot; </p>
<p><img class="style1" height="474" src="howtoImages/30.png" width="709" /></p>

    <p>
        The above image was taken before I&#39;d learnt some of Visual Studio&#39;s foibles.</p>
    <h2>
        WabDav </h2>
    <p>
        Using WabDav with the Tile Server</p>
        <div style = "background-color:Black">
    <p>
        <span class="style3">C:\Users\Nick&gt;net use * </span> <a href="http://www.khopchai.me/tileserver">
        <span class="style3">http://www.khopchai.me/tileserver</span></a><br 
            class="style3" />
        <span class="style3">Enter the user name for &#39;www.khopchai.me&#39;: tileserver</span><br 
            class="style3" />
        <span class="style3">Enter the password for </span> <a href="http://www.khopchai.me">
        <span class="style3">www.khopchai.me</span></a><span class="style3">: 
        ****123!</span><br class="style3" />
        <span class="style3">Drive Z: is now connected to </span> <a href="http://www.khopchai.me/tileserver">
        <span class="style3">http://www.khopchai.me/tileserver</span></a><span 
            class="style3">.
        </span>
        <br class="style3" />
        <span class="style3">The command completed successfully.</span></p>
    <p>
    </div>
        <h2>
            Routine Editing</h2>
    <p>
        That&#39;s <em>routine</em> as in &quot;usual&quot;, not routine as in &quot;procedure call&quot;. English 
        can be confusing!</p>
    <p>
        See <a href="editlifecycle.htm">Edit Life Cycle</a> for notes on routine editing.</p>
    <h2>
        MySQL</h2>
    <p>
        Both the staging and live web servers connect to the same database server.
    </p>
    <p>
        Connect using a <strong>MySQL Connector</strong> to the default port 3306 at 
        anotherurl.com.</p>
    <p>
        I suggest using <a href = "http://www.heidisql.com/">HeidiSQL </a> the&nbsp;&quot;lightweight interface to MySQL&quot;.</p>
    <h2>
        Dev Notes</h2>
    <p>
        <a href="http://dev.mysql.com/downloads/connector/net/6.0.html">
        http://dev.mysql.com/downloads/connector/net/6.0.html</a></p>
    <p>
        &nbsp;I chose Connector/Net 6.3.7 That's the latest at the time of writing. (Sept 2011)</p>
    <p>
        &nbsp;Click typical.</p>
    <h2>
        .NET development notes...</h2>
    <p>
        Use the .NET4.0 assembly, not the .NET 2.0.
        <br />
        The .NET 2.0 MySQL connector assembly incorrectly has a dependancy on .NET 4.0 - so 
        you may as well bite the bullet and use .NET 4.0.</p>
    <p>
        And, having bit that bullet we&#39;re using MVC 3 Razor Views.</p>
    <p>
        C:\Program Files\MySQL\MySQL Connector Net 6.3.7\Assemblies\v4.0</p>
    <h2>
        The on-line guesthouse editing tool</h2>
    <p>
        Guest houses can be added and edited on-line. All you need is knowledge of HTML 
        and an internet cafe to maintain the guesthouses.</p>
    <p>
        (If we&#39;re happy with this then we can extend this to other parts of the web 
        site.)</p>
    <p>
        Here&#39;s the editing page:</p>
    <p>
        <a href="Views/guesthousescrud.cshtml">Views/guesthousescrud.cshtml</a></p>
    <p>
        It shows the HTML in a read only design view, and the HTML source in a text box.</p>
    <p>
        Use the drop down list to select the guesthouse you want to work on. This shows 
        the location name, and the index of that record. (Vang Vieng 2 selects the 
        second Vang Vieng record.)</p>
    <p>
        You can delete it, or</p>
    <p>
        you can edit it and replace the original reord, or</p>
    <p>
        you can edit it, and save it as a new record.</p>
    <p>
        Edit the location edit box to change the location.</p>
    <p>
        Click &quot;view&quot; to see the public view:</p>
    <p>
        <a href="Views/guesthousesview.cshtml">Views/guesthousesview.cshtml</a></p>
    <h3>
        Notes</h3>
    <p>
        Use an existing record as a template - that saves messing up with the divs and 
        other mark-up.</p>
    <p>
        Nothing is deleted! If you make mistakes, look at&nbsp; the SQL:</p>
    <pre><code><span class="sql1-reservedword">use</span><span class="sql1-space"> </span><span 
        class="sql1-identifier">laostraveller</span><span class="sql1-symbol">;</span><span 
        class="sql1-space"> </span><span class="sql1-reservedword">select</span><span 
        class="sql1-space"> </span><span class="sql1-symbol">*</span><span 
        class="sql1-space"> </span><span class="sql1-reservedword">from</span><span 
        class="sql1-space"> </span><span class="sql1-tablename">gh</span><span 
        class="sql1-symbol">;</span></code></pre>
    <p>
        The hidden field is set if a record is hidden. Use the time stamp field to 
        locate the record you have &quot;deleted&quot; - it will still be there with the hidden 
        field set.</p>
    <p>
        (TO DO - add a server &quot;re-read&quot; interface - other wise you&#39;ll have to wait unit 
        the application pool goes stale - 20 minutes of inactivity)</p>
    <p>
        Developer note - The ad-hoc entry of data means this is not archived on 
        subversion - merely intermittent database backups performed by Nick - this 
        process needs to be formulised. </p>
    <p>
        From time to time old records will be purged:</p>
    <pre><code><span class="sql1-reservedword">delete</span><span 
        class="sql1-space"> </span><span class="sql1-reservedword">from</span><span 
        class="sql1-space"> </span><span class="sql1-tablename">gh</span><span 
        class="sql1-space"> </span><span class="sql1-reservedword">where</span><span 
        class="sql1-space"> </span><span class="sql1-identifier">hidden</span><span 
        class="sql1-space"> </span><span class="sql1-symbol">=</span><span 
        class="sql1-space"> </span><span class="sql1-number">1</span><span 
        class="sql1-symbol">;
</span></code></pre>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    </p>

</body>

</html>
